package GraphicInterface;
import com.cloudgarden.layout.AnchorLayout;

import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;

import javax.swing.JPanel;
import javax.swing.WindowConstants;
import javax.swing.JFrame;
import javax.swing.JLabel;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class AdicionarSala extends javax.swing.JPanel {
	private JLabel AdicionarSalasTitulo;
	private JButton jButtonVoltar;
	private JPanel previous;

//	/**
//	* Auto-generated main method to display this 
//	* JPanel inside a new JFrame.
//	*/
//	public static void main(String[] args) {
//		JFrame frame = new JFrame();
//		frame.getContentPane().add(new AdicionarSala());
//		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
//		frame.pack();
//		frame.setVisible(true);
//	}
//	
	public AdicionarSala(JPanel previous) {
		super();
		this.previous = previous;
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.setPreferredSize(new java.awt.Dimension(797, 299));
			this.setSize(784, 333);
			this.setLayout(null);
			{
				AdicionarSalasTitulo = new JLabel();
				this.add(AdicionarSalasTitulo);
				AdicionarSalasTitulo.setLayout(null);
				AdicionarSalasTitulo.setText("Adicionar Salas");
				AdicionarSalasTitulo.setBounds(300, 21, 180, 47);
				AdicionarSalasTitulo.setOpaque(true);
				AdicionarSalasTitulo.setFont(new java.awt.Font("Segoe UI",0,26));
			}
			{
				jButtonVoltar = new JButton();
				this.add(jButtonVoltar);
				jButtonVoltar.setText("Voltar");
				jButtonVoltar.setBounds(699, 289, 74, 33);
				jButtonVoltar.addMouseListener(new MouseAdapter() {
					public void mousePressed(MouseEvent evt) {
						jButtonVoltarMousePressed(evt);
					}
				});
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private void jButtonVoltarMousePressed(MouseEvent evt) {
		System.out.println("jButtonVoltar.mousePressed, event="+evt);
		this.setVisible(false);
		previous.setVisible(true);
				
	}

}
